package io.shuttle.mbe.api

import io.shuttle.mbe.api.annotation.PromiseStyleMinVersion
import io.shuttle.mbe.api.types.Value1Function
import io.shuttle.mbe.core.Promise

////////////////////
// Top Sites
////////////////////
/**
 * Use the `Browser.topSites` API to access the top sites (i.e. most visited sites) that are displayed on the new tab page. These do not include shortcuts customized by the user.
 *
 * Permissions: "topSites"
 */
interface TopSites {

    // Gets a list of top sites.
    @PromiseStyleMinVersion(96)
    abstract fun get(callback: Value1Function<List<MostVisitedURL>>? = null): Promise<List<MostVisitedURL>>

    // An object encapsulating a most visited URL, such as the default shortcuts on the new tab page.
    data class MostVisitedURL(
        // The title of the page
        var title: String,
        // The most visited URL.
        var url: String,
    )
}